#ifndef AVALON_SERIALIZER_HPP
#define AVALON_SERIALIZER_HPP
#include "Avalon/Serialization/DataShuttle.hpp"

namespace Avalon {
namespace Serialization {

  /*! \class Serializer
   *  \brief Base class for a DataShuttle that stores data.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class Serializer : public DataShuttle {
    public:

      virtual ~Serializer();

      //! Returns the serialized data.
      virtual IO::Buffer GetSerializedData() = 0;

      virtual bool IsReceiving();

      using DataShuttle::Shuttle;

    private:
      std::map<const std::type_info*, int> m_typeInfoToConstructorIndex;
      std::map<const std::type_info*, int> m_typeInfoToSharedConstructorIndex;

      virtual void SendNull();
      virtual void SendPointer(const std::type_info& typeInfo);
      virtual void SendSharedPointer(const std::type_info& typeInfo);
  };
}
}

#endif // AVALON_SERIALIZER_HPP
